# Termes du lexique par catégorie de violences
generale <- c("violemment", "violamment", "violence", "violences", "violente",
"violentes", "violent", "violents", "violentometre","violenter",
"victime", "victimes", "tw")
physique <- c("blessure", "blessures",
"hematome", "hematomes",
"fracture", "fractures",
"passage à tabac", "strangulation", "sequestration", "sequestrations", "torture",
"gifle", "gifler", "gifles",
"bousculer", "bouscule",
"battre", "battu", "battue",
"subir des coups",
"frappe", "frapper",
"poing", "poings",
"baffe", "baffes",
"battre", "battu", "battus", "battue", "battues",
"blessure", "blessures",
"claque", "claques", "etrangler", "etrangle", "taper")
verbale <- c("injures",
"menaces", "menace", "menacer",
"propos degradants",
"abus", "abusif", "abusive", "abusifs", "abusives", "abuse", "abuses", "abuser",
"colere", "coleres",
"crier", "cri", "cris",
"insultant", "insultante", "insulte", "insultes", "insulter",
"traiter", "verbalement",
"enervement", "enervements")
psy <- c("intimidation", "intimidations",
"chantage", "chantages",
"culpabilisation",
"contrôle", "m isole", "m isolait",
"rabaissser", "rabaisse",
"manipulation", "manipulations", "manipule", "manipuler",
"intimider",
"gaslighting", "gaslight", "gaslighte",
"mettre la pression",
"humiliation", "humiliations", "humilier", "humilie", "humilies",
"narcissique")
harcel <- c("stalk", "stalke", "stalking", "stalkait", "stalkais",
"surveiller", "surveille",
"traquer", "traque",
"importuner", "messages repetes",
"insistance",
"intrusif", "intrusive",
"harcele", "harcelement", "harcelements", "harceler")
sexuelle <- c("coercition",
"consentement",
"contraindre",
"contrainte", "contraint", "sous contrainte",
"accoste", "accostes", "accoster", "attraper",
"agresse", "agresses", "agresser", "agression",
"agressions", "agression sexuelle", "agressions sexuelles",
"attouchement", "attouchements", "attouche",
"inceste", "incestes", "incestueux", "incestueuse", "incestueuses", "incestuel", "incestuels", "incestuelle", "incestuelles",
"pedophilie", "pedophile", "pedophiles",
"rapport non consenti", "rapports non consentis",
"sexe non consenti",
"viol", "viole", "viols", "violes", "violer")
domeco <- c("maltraitance",
"maltraitances",
"dependance",
"privation",
"conjugal", "conjugals", "conjugale", "conjugales", "conjugaux",
"emprise"
)
numerique <- c("cyberharcelement",
"doxxing",
"doxxe",
"revenge porn",
"piratage",
"usurper l identite")
discrimination <- c("racisme", "raciste",
"sexisme", "sexiste",
"mysogine", "mysoginie",
"homophobie", "homophobe",
"transphobie", "transphobe",
"validisme", "validiste",
"antisemitisme", "antisemite",
"islamophobie", "islamophobe",
"discrimination", "discriminations", "discrimine",
"stigamatise", "stigmatiser",
"attaquer", "attaque")
insti_symb <- c("negligence",
"injustice", "injustices",
"sterotype", "stereotypes",
"domination", "dominations",
"mepris", "meprise", "meprisant", "meprisante",
"invisibilisation", "invisibilise", "invisibiliser",
"impose", "imposer", "minimiser", "minimise",
"ridiculiser", "ridiculise", "marginaliser", "marginalise",
"normaliser", "normalise",
"plainte", "plaintes", "police",
"temoignage", "temoignages", "temoigner", "temoin", "temoins")
# Create named list for easier processing
violence_categories <- list(
generale = generale,
physique = physique,
verbale = verbale,
psy = psy,
harcel = harcel,
sexuelle = sexuelle,
domeco = domeco,
numerique = numerique,
discrimination = discrimination,
insti_symb = insti_symb
)
# Simplified function to map terms to groups
map_term_to_group <- function(term, category) {
term_lower <- tolower(term)
# First, handle multi-word terms (keep them as is)
multi_word_terms <- c(
"passage à tabac", "propos degradants", "m isole", "m isolait",
"mettre la pression", "messages repetes", "sous contrainte",
"agression sexuelle", "agressions sexuelles", "rapport non consenti",
"rapports non consentis", "sexe non consenti", "revenge porn",
"usurper l'identite", "subir des coups"
)
if (term %in% multi_word_terms) {
return(term) # Keep multi-word terms as is
}
# Single word terms - simple stem extraction
case_when(
# Keep original mapping for terms you already had
str_detect(term_lower, "\\b(accoste|accoster)\\b") ~ "accost",
str_detect(term_lower, "\\b(attraper|attrape)\\b") ~ "attrape",
str_detect(term_lower, "\\b(agresse|agresser|agression)\\b") ~ "agress",
str_detect(term_lower, "\\b(attouchement|attouchements|attouche)\\b") ~ "attouchement",
str_detect(term_lower, "\\b(frappe|frapper|poing|poings)\\b") ~ "frappe/poing",
str_detect(term_lower, "\\b(abusif|abusive|abus|abusifs|abusives|abuse|abuses|abuser)\\b") ~ "abus",
str_detect(term_lower, "\\b(harcele|harcelement|harceler)\\b") ~ "harcel",
str_detect(term_lower, "\\b(inceste|pedophilie)\\b") ~ "inceste/pedophilie",
str_detect(term_lower, "\\b(insultant|insultante|insulte|insulter|insultes)\\b") ~ "insult",
str_detect(term_lower, "\\b(viol|viole|violer|viols|violes)\\b") ~ "viol",
str_detect(term_lower, "\\b(violemment|violamment|violence|violences|violent|violents|violente|violentes|violentometre|violenter)\\b") ~ "violen",
str_detect(term_lower, "\\b(conjugal|conjugale|conjugaux)\\b") ~ "conjugal",
# New groupings based on your terms
str_detect(term_lower, "^victim") ~ "victime",
# Physical violence
str_detect(term_lower, "^blessur") ~ "blessure",
str_detect(term_lower, "^hematom") ~ "hematome",
str_detect(term_lower, "^fractur") ~ "fracture",
str_detect(term_lower, "^strangul") ~ "strangulation",
str_detect(term_lower, "^sequestr") ~ "sequestration",
str_detect(term_lower, "^tortur") ~ "torture",
str_detect(term_lower, "^gifl") ~ "gifle",
str_detect(term_lower, "^bouscul") ~ "bousculer",
str_detect(term_lower, "^batt") ~ "battre",
str_detect(term_lower, "^claqu") ~ "claque",
str_detect(term_lower, "^etrangl") ~ "etrangler",
str_detect(term_lower, "^tap") ~ "taper",
str_detect(term_lower, "^baff") ~ "baffe",
# Verbal violence
str_detect(term_lower, "^injure") ~ "injure",
str_detect(term_lower, "^menac") ~ "menace",
str_detect(term_lower, "^rabais") ~ "rabaisser",
str_detect(term_lower, "^coler") ~ "colere",
str_detect(term_lower, "^cri") ~ "crier",
str_detect(term_lower, "^trait") ~ "traiter",
# Psychological violence (including humiliation)
str_detect(term_lower, "^intimid") ~ "intimidation",
str_detect(term_lower, "^chantag") ~ "chantage",
str_detect(term_lower, "^culpabilis") ~ "culpabilisation",
str_detect(term_lower, "^contrôl") ~ "contrôle",
str_detect(term_lower, "^manipul") ~ "manipulation",
str_detect(term_lower, "^gaslight") ~ "gaslighting",
str_detect(term_lower, "^humili") ~ "humiliation",
str_detect(term_lower, "^narciss") ~ "narcissique",
# Harassment
str_detect(term_lower, "^stalk") ~ "stalking",
str_detect(term_lower, "^surveill") ~ "surveiller",
str_detect(term_lower, "^traqu") ~ "traquer",
str_detect(term_lower, "^importun") ~ "importuner",
str_detect(term_lower, "^insist") ~ "insistance",
str_detect(term_lower, "^intrus") ~ "intrusif",
# Sexual violence
str_detect(term_lower, "^coercit") ~ "coercition",
str_detect(term_lower, "^consent") ~ "consentement",
str_detect(term_lower, "^contraint") ~ "contrainte",
str_detect(term_lower, "^pedophil") ~ "pedophile",
# Domestic/Economic violence
str_detect(term_lower, "^maltrait") ~ "maltraitance",
str_detect(term_lower, "^depend") ~ "dependance",
str_detect(term_lower, "^privat") ~ "privation",
str_detect(term_lower, "^empris") ~ "emprise",
str_detect(term_lower, "^enerv") ~ "enervement",
# Digital violence
str_detect(term_lower, "^cyberharcel") ~ "cyberharcelement",
str_detect(term_lower, "^doxx") ~ "doxxing",
str_detect(term_lower, "^pirat") ~ "piratage",
# Discrimination
str_detect(term_lower, "^racis") ~ "racisme",
str_detect(term_lower, "^sexis") ~ "sexisme",
str_detect(term_lower, "^mysog") ~ "mysoginie",
str_detect(term_lower, "^homophob") ~ "homophobie",
str_detect(term_lower, "^transphob") ~ "transphobie",
str_detect(term_lower, "^validis") ~ "validisme",
str_detect(term_lower, "^antisemi") ~ "antisemitisme",
str_detect(term_lower, "^islamophob") ~ "islamophobie",
str_detect(term_lower, "^discrimin") ~ "discrimination",
str_detect(term_lower, "^stigmat") ~ "stigmatisation",
str_detect(term_lower, "^attaqu") ~ "attaque",
# Institutional/Symbolic violence
str_detect(term_lower, "^plaint") ~ "plainte",
str_detect(term_lower, "^temoi") ~ "temoign",
str_detect(term_lower, "^police") ~ "police",
str_detect(term_lower, "^neglig") ~ "negligence",
str_detect(term_lower, "^injust") ~ "injustice",
str_detect(term_lower, "^stereotyp") ~ "stereotype",
str_detect(term_lower, "^domin") ~ "domination",
str_detect(term_lower, "^mepris") ~ "mepris",
str_detect(term_lower, "^invisibil") ~ "invisibilisation",
str_detect(term_lower, "^impos") ~ "imposer",
str_detect(term_lower, "^minimis") ~ "minimiser",
str_detect(term_lower, "^ridiculis") ~ "ridiculiser",
str_detect(term_lower, "^marginalis") ~ "marginaliser",
str_detect(term_lower, "^normalis") ~ "normaliser",
# Keep all other terms as is (no declension)
TRUE ~ term
)
}
# Create dataframe
df_lexique <- data.frame()
for (category_name in names(violence_categories)) {
category_terms <- violence_categories[[category_name]]
for (term in category_terms) {
group <- map_term_to_group(term, category_name)
df_lexique <- rbind(df_lexique, data.frame(
type_violence = category_name,
terme_original = term,
racine = group, # Using group as the root
stringsAsFactors = FALSE
))
}
}
# Remove duplicates
df_lexique <- df_lexique %>%
distinct(type_violence, terme_original, .keep_all = TRUE)
# Order by type_violence and terme_original
df_lexique <- df_lexique %>%
arrange(type_violence, terme_original)
# Create a version with all forms grouped by root
df_lexique_grouped <- df_lexique %>%
group_by(type_violence, racine) %>%
summarise(
formes = paste(sort(unique(terme_original)), collapse = ", "),
nb_formes = n(),
.groups = 'drop'
) %>%
arrange(type_violence, racine)
resume <- df_lexique_grouped %>%
group_by(type_violence) %>%
summarise(all_racine= paste0(racine, collapse = ", "),
all_termes = paste0(formes, collapse = ", ")) %>%
ungroup()
resume_dt <- datatable(resume,
filter = "top", # 🔹 adds per-column filters
options = list(
pageLength = 10, # Show 15 rows per page
scrollX = TRUE, # Horizontal scroll if needed
scrollY = "400px" # Fixed height with vertical scroll
),
class = 'display compact', # Compact styling
rownames = FALSE # Hide row numbers
)
resume_dt